import parole
from parole.colornames import colors
from parole.display import interpolateRGB
import pygame, random

import sim, main
from util import *
from dungeon import makeFloor, Room, TemplateRoom
import dungeon

template = \
"""
################### ####################
#%  h h h     ##### ##### A  A  A  A  ]#
#[ ooooooo    ##### #####             ]#
#[ ooooooo    +   + +   +             ]#
#%  h h h     ##### ##### A  A  A  A  ]#
################### ####################
#  ^ ^ ^ ^ ^ ^ ^  # #*  h   + +       *#
#   ^ ^ ^ ^ ^ ^   # #U      # #   o   U#
########+########## #########+##########
#A                + +                 A#
#+###+##+#####+####+########+###########
#  #h #  #        # #A    A# #A   U   A#
# o#  #  #        # #  @o  # #         #
#U #U #U # &&&&&  #>#A     + +  %%%%%  #
########################################

"""[1:]

legend = {
     '[':    parole.map.MapObjectGenerator("", 
            lambda: sim.Obj('fire place', 10, parole.map.AsciiTile('[',
                colors['Black']),
                blockMove=True, massNoun=False, startsVowel=False),
            clearFirst=False),
    
     ']':    parole.map.MapObjectGenerator("", 
            lambda: sim.Obj('bookshelf', 10, parole.map.AsciiTile(']',
                colors['FireBrick']),
                blockMove=True, massNoun=False, startsVowel=False),
            clearFirst=False),
    
     '^':    parole.map.MapObjectGenerator("", 
            lambda: sim.Obj('comestibles', 10, parole.map.AsciiTile('^',
                colors['White']),
                blockMove=False, massNoun=True, startsVowel=False),
            clearFirst=False),

     'h':    parole.map.MapObjectGenerator("", 
            lambda: sim.Obj('chair', 10, parole.map.AsciiTile('h',
                colors['Black']),
                blockMove=True, massNoun=False, startsVowel=False),
            clearFirst=False),

     'o':    parole.map.MapObjectGenerator("", 
            lambda: sim.Obj('table', 10, parole.map.AsciiTile('o',
                colors['DarkKhaki']),
                blockMove=True, massNoun=False, startsVowel=False),
            clearFirst=False),

     '*':    parole.map.MapObjectGenerator("", 
            lambda: sim.Obj('orchid', 10, parole.map.AsciiTile('*',
                colors['Fuchsia']),
                blockMove=False, massNoun=False, startsVowel=True),
            clearFirst=False),

     '@':    parole.map.MapObjectGenerator("", 
            lambda: sim.Obj('mayor', 10, parole.map.AsciiTile('@',
                colors['White']),
                blockMove=True, massNoun=False, startsVowel=False),
            clearFirst=False),
    
     'U':    parole.map.MapObjectGenerator("", 
            lambda: sim.Obj('bed', 10, parole.map.AsciiTile('U',
                colors['White']),
                blockMove=True, massNoun=False, startsVowel=False),
            clearFirst=False),

     '&':    parole.map.MapObjectGenerator("", 
            lambda: sim.Obj('stove', 10, parole.map.AsciiTile('&',
                colors['Black']),
                blockMove=True, massNoun=False, startsVowel=False),
            clearFirst=False),

     'A':    parole.map.MapObjectGenerator("", 
            lambda: sim.Obj('suit of armor', 10, parole.map.AsciiTile('A',
                colors['Black']),
                blockMove=True, massNoun=False, startsVowel=False),
            clearFirst=False),

     '+':    parole.map.MapObjectGenerator("", 
            lambda: sim.Obj('door', 10, parole.map.AsciiTile('+',
                colors['SaddleBrown']),
                blockMove=True, massNoun=False, startsVowel=False),
            clearFirst=False),

     '#':    dungeon.rockGenerator(colors['DimGray']),
}

floorColor1 = colors['SaddleBrown']
floorColor2 = colors['SandyBrown']
floorName = 'oak floor'
mixture = 0.8

diggable = [
    (19,0),
]

class store(TemplateRoom):
    def __init__(self, pos):
        TemplateRoom.__init__(self, template, legend, diggable, pos,
                floorColor1, floorColor2, mixture, floorName)


roomClass = store



